package com.hspedu.static_;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/26
 * @time 17:25
 */
public class StaticMethod {
    public static void main(String[] args) {
        Student jack = new Student("jack");
        jack.payFee(100);

        Student mary = new Student("mary");
        mary.payFee(200);

        Student.getFee();
    }
}

class Student{
    private String name;
    private static double fee;

    public Student(String name) {
        this.name = name;
    }

    public void payFee(double fee){
        Student.fee += fee;
    }

    public static void getFee(){
        System.out.println(Student.fee);
    }
}
